

import 'package:flutter/cupertino.dart';
import 'package:flutter_fun_zjversion/ui/page/lottery.dart';
import 'package:flutter_fun_zjversion/ui/page/splash.dart';
import 'package:flutter_fun_zjversion/ui/page/tab_navigator.dart';
import 'package:flutter_fun_zjversion/ui/widget/page_route_anim.dart';

class RouteName{
  static const String splash = 'splash';
  static const String tab = '/';
  static const String lottery = 'lottery';
  static const String homeSecondFloor = 'homeSecondFloor';
  static const String login = 'login';
  static const String register = 'register';
  static const String articleDetail = 'articleDetail';
  static const String structureList = 'structureList';
  static const String favouriteList = 'favouriteList';
  static const String setting = 'setting';
  static const String coinRecordList = 'coinRecordList';
  static const String coinRankingList = 'coinRankingList';
}


class Router {
  static Route<dynamic> generateRoute(RouteSettings settings){
     switch(settings.name){
       case RouteName.splash:
         return NoAnimRouteBuilder(SplashPage());
       case RouteName.lottery:
         return NoAnimRouteBuilder(LotteryPage());
       case RouteName.tab:
         return NoAnimRouteBuilder(TabNavigator());
     }
  }

}


class PopRoute extends PopupRoute{
  Widget child;
  final Duration _duration = Duration(milliseconds: 300);
  @override
  Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
    // TODO: implement buildPage
    return child;
  }

  @override
  bool get barrierDismissible =>true;

  @override
  // TODO: implement transitionDuration
  Duration get transitionDuration => _duration;

  @override
  Color get barrierColor => null;

  @override
  String get barrierLabel => null;

}